package shooting.ui.missile
{
	import flash.events.EventDispatcher;
	import flash.geom.Point;
	
	import shooting.ui.move.BagicMoveFunc;

	public class MissaleBase  extends EventDispatcher implements IMissile
	{
		private var m_Kind:String;
		private var m_Speed:Number;
		private var m_MoveFunc:Function;
		private var m_direction:Number;
		private var m_StartPosition:Point;
		private var m_Position:Point = new Point;
		private var m_isRemove:Boolean = false;
		
		private var renderCount:Number = 0;
		
		public function MissaleBase(kind:String, startPosition:Point, speed:Number = 1, direction:Number = 0)//, moveFunc:Function = BagicMoveFunc.moveForward
		{
			m_Kind = kind;
			m_Speed = speed;
			m_direction = direction;
			m_StartPosition = startPosition;
			m_MoveFunc = BagicMoveFunc.moveForward;
		}
		
		public function get isRemove():Boolean
		{
			return m_isRemove;
		}
		public function set isRemove(flag:Boolean):void
		{
			m_isRemove = flag;
		}
		public function get kind():String
		{
			return m_Kind;
		};
		public function get dirction():Number
		{
			return m_direction;
		}
		public function render():void
		{
			renderCount ++;
			m_Position = m_MoveFunc(m_StartPosition, m_Speed, m_direction, renderCount);
		}
		
		public function getPosition():Point
		{
			
			return m_Position;
		}
		
	}
}